<?php

namespace Fuel\Migrations;

class Create_genres
{
	public function up()
	{
		\DBUtil::create_table('genres', array(
			'id' => array('constraint' => 11, 'type' => 'int', 'auto_increment' => true),
			'genre_lv' => array('constraint' => 100, 'type' => 'varchar'),
			'genre_en' => array('constraint' => 100, 'type' => 'varchar')
		), array('id'));
                
	    $genre = \Model_Orm_Genre::forge();     //1
	    $genre->genre_lv = "Asa sižeta";
	    $genre->genre_en = "Action";
	    $genre->save();	
            
	    $genre2 = \Model_Orm_Genre::forge();    //2
	    $genre2->genre_lv = "Šausmu filmas";
	    $genre2->genre_en = "Horror movies";
	    $genre2->save();	
            
	    $genre3 = \Model_Orm_Genre::forge();    //3
	    $genre3->genre_lv = "Dokumentālās filmas";
	    $genre3->genre_en = "Documentary";
	    $genre3->save();	
            
	    $genre4 = \Model_Orm_Genre::forge();    //4
	    $genre4->genre_lv = "Zinātniskā fantastika";
	    $genre4->genre_en = "Science fiction";
	    $genre4->save();	
            
 	    $genre5 = \Model_Orm_Genre::forge();    //5
	    $genre5->genre_lv = "Detektīvfilmas";
	    $genre5->genre_en = "Detective movies";
	    $genre5->save();
            
 	    $genre6 = \Model_Orm_Genre::forge();    //6
	    $genre6->genre_lv = "Piedzīvojumu filmas";
	    $genre6->genre_en = "Adventure movies";
	    $genre6->save();
            
 	    $genre7 = \Model_Orm_Genre::forge();    //7
	    $genre7->genre_lv = "Multfilmas";
	    $genre7->genre_en = "Cartoons";
	    $genre7->save();
            
 	    $genre8 = \Model_Orm_Genre::forge();    //8
	    $genre8->genre_lv = "Komēdijas";
	    $genre8->genre_en = "Comedy";
	    $genre8->save();
	}

	public function down()
	{
		\DBUtil::drop_table('genres');
	}
}